<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:wb="http://open.weibo.com/wb" class=" widthauto">
<head>

<title></title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="css/select.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/jquery-2.0.0.js"></script>
<script type="text/javascript" src="js/jquery.idTabs.min.js"></script>
<script type="text/javascript" src="js/select-ui.min.js"></script>
<script type="text/javascript" src="../js/layer/layer.js"></script>

<script type="text/javascript">
	//禁言
	function jinyan(a){
		var r = confirm("确定要禁言该用户吗？");
		if (r==true) {
			location.href = "UserAction_banSpeech.action?pid="+a.id;
		}
	}
	//取消禁言
	function cancel_jinyan(a){
		var r = confirm("确定要取消该用户的禁言吗？");
		if (r==true) {
			location.href = "UserAction_cancelBanSpeech.action?pid="+a.id;
		}
	}
	
	function updateUserModerator(a){
		var uid = a.id;
		layer.open({
		  type: 2,
		  title: '设置版主',
		  shadeClose: true,
		  shade: 0.2,
		  area: ['250px', '40%'],
		  content: 'userModerator.jsp?uid='+uid //iframe的url
		}); 
	}

	function goPage(a){
		var id = a.id;
		location.href = id;
	}	

	function form_submit(){
		$("#userlist").submit();
	}

	$(document).ready(function() {
		$(".select1").uedSelect({
			width : 345
		});
		$(".select2").uedSelect({
			width : 167
		});
		$(".select3").uedSelect({
			width : 100
		});

		$(".click").click(function() {
			$(".tip").fadeIn(200);
		});

		$(".tiptop a").click(function() {
			$(".tip").fadeOut(200);
		});

		$(".sure").click(function() {
			$(".tip").fadeOut(100);
		});

		$(".cancel").click(function() {
			$(".tip").fadeOut(100);
		});

	});
</script>

</head>

<body>
	<div class="place">
		<span>位置：</span>
		<ul class="placeul">
			<li><a href="#">用户管理</a>
			</li>
			<li><a href="#">用户列表</a>
			</li>
		</ul>
	</div>

	<div class="rightinfo">
		<form action="UserAction_getPageUser.action" method="post" id="userlist">
		<ul class="seachform">
			<li><label>用户昵称</label><input name="nickName" type="text" class="scinput" />
			</li>
			<li><label>籍贯</label>
				<div class="vocation">
					<select class="select3" name="provinces">
						<option value="">全部</option>
						<option value="北京">北京</option>
						<option value="天津">天津</option>
						<option value="河北">河北</option>
						<option value="山西">山西</option>
						<option value="内蒙古">内蒙古</option>
						<option value="辽宁">辽宁</option>
						<option value="吉林">吉林</option>
						<option value="黑龙江">黑龙江</option>
						<option value="上海">上海</option>
						<option value="江苏">江苏</option>
						<option value="浙江">浙江</option>
						<option value="安徽">安徽</option>
						<option value="福建">福建</option>
						<option value="江西">江西</option>
						<option value="山东">山东</option>
						<option value="河南">河南</option>
						<option value="湖北">湖北</option>
						<option value="湖南">湖南</option>
						<option value="广东">广东</option>
						<option value="广西">广西</option>
						<option value="海南">海南</option>
						<option value="重庆">重庆</option>
						<option value="四川">四川</option>
						<option value="贵州">贵州</option>
						<option value="云南">云南</option>
						<option value="西藏">西藏</option>
						<option value="陕西">陕西</option>
						<option value="甘肃">甘肃</option>
						<option value="青海">青海</option>
						<option value="宁夏">宁夏</option>
						<option value="新疆">新疆</option>
						<option value="香港">香港</option>
						<option value="澳门">澳门</option>
						<option value="台湾">台湾</option>
						<option value="国外">国外</option>
					</select>
				</div></li>
			<!-- <li><label>注册时间</label><input name="" type="text" class="scinput" /></li> -->
			<li><label>用户状态</label>
				<div class="vocation">
					<select class="select3" name="status">
						<option value="">全部</option>
						<option value="-1">禁言</option>
						<option value="0">正常</option>
					</select>
				</div></li>
			<li><label>&nbsp;</label><input type="button" class="scbtn" value="查询" onclick="form_submit()"/>
			</li>
		</ul>
		</form>
		<table class="tablelist">
			<thead>
				<tr>
					<!-- <th><input name="" type="checkbox" value="" checked="checked"/></th> -->
					<th>编号<i class="sort"></i>
					</th>
					<th>用户昵称</th>
					<th>性别</th>
					<th>籍贯</th>
					<th>注册时间</th>
					<th>用户状态</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach items="${request.querypage.queryResult }" var="user">
				<tr>
					<td>${user.id }</td>
					<td>${user.nickName }</td>
					<td>
						<c:if test="${user.sex==1 }">男</c:if>
						<c:if test="${user.sex==0 }">女</c:if>
					</td>
					<td>${user.provinces }</td>
					<td>${user.registTime}</td>
					<td>
						<c:if test="${user.status==0 }">正常</c:if>
						<c:if test="${user.status==-1 }">禁言</c:if>
						<c:if test="${user.status==1 }">装备交流版主</c:if>
						<c:if test="${user.status==2 }">活动发布版主</c:if>
						<c:if test="${user.status==3 }">游记攻略版主</c:if>
						<c:if test="${user.status==4 }">优秀个人版主</c:if>
						<c:if test="${user.status==5 }">户外摄影版主</c:if>
					</td>
					<td><a href="../main/UserAction_getPersonHome.action?uid=${user.id }" class="tablelink" target="_Blank">查看</a>
					<c:if test="${user.status!=-1 }">
						<a href="javascript:void(0)" onclick="jinyan(this)" id="${user.id }" class="tablelink"> 禁言</a>
					</c:if> 
					<c:if test="${user.status==-1 }">
						<a href="javascript:void(0)" onclick="cancel_jinyan(this)" id="${user.id }" class="tablelink"> 取消禁言 </a>
					</c:if>
						<a href="javascript:void(0)" class="tablelink" id="${user.id }" onclick="updateUserModerator(this)">设置版主</a>
					</td>
				</tr>
				</c:forEach>
			</tbody>
		</table>


		<div class="pagin">
			<div class="message">
				共<i class="blue">${querypage.recordCount }</i>条记录，<i class="blue">${querypage.pageCount }</i>页，当前显示第&nbsp;<i class="blue">${querypage.currentPageNo }&nbsp;</i>页
			</div>
			<ul class="paginList">
				<li class="paginItem">
				<c:if test="${querypage.currentPageNo>1 }">
				    <a id="UserAction_getPageUser.action?pagenum=${querypage.currentPageNo-1 }" onclick="goPage(this)">
				    	<span class="pagepre"></span><!-- 上一页 -->
				    </a>
				</c:if>
				</li>
				<li class="paginItem current">
					<a href="javascript:;">${querypage.currentPageNo }</a>
				</li>
				<li class="paginItem">
				<c:if test="${querypage.currentPageNo<querypage.pageCount }">
	    			<a id="UserAction_getPageUser.action?pagenum=${querypage.currentPageNo+1 }" onclick="goPage(this)">
	    				<span class="pagenxt"></span>
	    			</a>
	    		</c:if>
				</li>
			</ul>
		</div>

		<div class="tip">
			<div class="tiptop">
				<span>提示信息</span><a></a>
			</div>

			<div class="tipinfo">
				<span><img src="images/ticon.png" />
				</span>
				<div class="tipright">
					<p>是否确认对信息的修改 ？</p>
					<cite>如果是请点击确定按钮 ，否则请点取消。</cite>
				</div>
			</div>

			<div class="tipbtn">
				<input name="" type="button" class="sure" value="确定" />&nbsp; <input
					name="" type="button" class="cancel" value="取消" />
			</div>

		</div>

	</div>
	<script type="text/javascript">
		$(".rightinfo ul").idTabs();
	</script>
	<script type="text/javascript">
		$('.tablelist tbody tr:odd').addClass('odd');
	</script>
</body>
</html>
